//
//  MYMySetAttentionCell.swift
//  MuYing
//
//  Created by tbb on 2019/8/8.
//  Copyright © 2019 TBB. All rights reserved.
//

import UIKit

class MYMySetAttentionCell: YQTableViewBaseCell {
    @objc @IBOutlet weak var userIcon: UIImageView!
    
    @objc @IBOutlet weak var nameLb: UILabel!
    
    @objc @IBOutlet weak var attentionBtn: QMUIGhostButton!
    
    @objc var isSelectBtn = false {
        didSet {
            self.attentionBtn.isSelected = isSelectBtn
            if isSelectBtn {
                self.attentionBtn.ghostColor = appThreeTitleColor;
            }else{
                self.attentionBtn.ghostColor = appThemeColor;
            }
        }
    }
    
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.attentionBtn.addTarget(self, action: #selector(attentionAction(_:)), for: .touchUpInside);
//        self.attentionBtn.isSelected = isSelectBtn
//        if isSelectBtn {
//            self.attentionBtn.ghostColor = appThreeTitleColor;
//        }else{
//            self.attentionBtn.ghostColor = appThemeColor;
//        }
        
        self.userIcon.layer.cornerRadius = 14;
        self.userIcon.clipsToBounds = true;
        
        self.attentionBtn.setTitle(kYQLSSwift("+关注"), for: .normal);
        self.attentionBtn.setTitle(kYQLSSwift("已关注"), for: .selected);
        
        self.attentionBtn.setTitleColor(appThemeColor, for: .normal);
        self.attentionBtn.setTitleColor(appThreeTitleColor, for: .selected);
    }
    @objc func attentionAction(_ sender: QMUIGhostButton)  {
        sender.isSelected = !sender.isSelected;
        self.isSelectBtn = sender.isSelected;
    }
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
